﻿<Window x:Class="Tum.PDE.LanguageDSL.Visualization.View.Optimization.OptimizationControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
        
             Title="{Binding Path=CurrentOptimizationVM.Title}"
             WindowStartupLocation="CenterScreen"
             WindowStyle="ToolWindow"
        
             xmlns:view="clr-namespace:Tum.PDE.LanguageDSL.Visualization.View.Optimization"
             xmlns:attached="clr-namespace:Tum.PDE.LanguageDSL.Visualization.Attached"
        
             TextOptions.TextFormattingMode="Display">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="1"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
            
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition MinWidth="150" Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <TextBlock Text="{Binding Path=CurrentOptimizationVM.Optimization.Title}" Margin="5" FontSize="16" TextDecorations="Underline" Grid.Column="0"/>
            <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                <TextBlock Text="{Binding Path=CurrentNumber, Mode=OneWay}" Margin="3, 7, 3, 3"/>                
                <Button Margin="2,2,0,2" Focusable="False" Background="Transparent" BorderBrush="Transparent" BorderThickness="0"
                        Command="{Binding Path=PrevOptimizationCommand, Mode=OneWay}" Width="22" Height="22">
                    <Image Width="16" Height="16" Source="/Tum.PDE.LanguageDSL.Visualization;component/Resources/Images/Back-32.png"/>
                </Button>
                <Button Margin="0,2,0,2" Focusable="False" Background="Transparent" BorderBrush="Transparent" BorderThickness="0"
                        Command="{Binding Path=NextOptimizationCommand, Mode=OneWay}"  Width="22" Height="22">
                    <Image Width="16" Height="16" Source="/Tum.PDE.LanguageDSL.Visualization;component/Resources/Images/Forward-32.png"/>
                </Button>
            </StackPanel>
        </Grid>

        <TextBlock Text="{Binding Path=CurrentOptimizationVM.Optimization.Description}" Margin="5" Grid.Row="1" TextWrapping="WrapWithOverflow"/>
        <Border BorderBrush="LightSteelBlue" BorderThickness="1" Grid.Row="2"></Border>
        
        <Grid Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <GroupBox Header="Current" Grid.Column="0">
                <view:ConversionModelControl DataContext="{Binding Path=CurrentOptimizationVM.SourceModelVM}"/>
            </GroupBox>

            <Image Width="32" Height="32" Source="/Tum.PDE.LanguageDSL.Visualization;component/Resources/Images/Forward-32.png" Grid.Column="1"
                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
            
            <GroupBox Header="After Optimization" Grid.Column="2">
                <view:ConversionModelControl DataContext="{Binding Path=CurrentOptimizationVM.TargetModelVM}"/>
            </GroupBox>

        </Grid>

        <Border BorderBrush="LightSteelBlue" BorderThickness="1" Grid.Row="4"></Border>
        <StackPanel Orientation="Horizontal" Grid.Row="5"  HorizontalAlignment="Right">
            <Button Margin="2,2,0,2" attached:ButtonHelper.DialogResult="True">
                <StackPanel Orientation="Horizontal">
                    <Image Width="16" Height="16" Source="/Tum.PDE.LanguageDSL.Visualization;component/Resources/Images/Check-16.png" Margin="2,0,3,0"/>
                    <TextBlock Text="Apply" Margin="0,0,3,0"/>
                </StackPanel>
            </Button>

            <Button Margin="4,2,2,2" IsCancel="True">
                <StackPanel Orientation="Horizontal">
                    <Image Width="16" Height="16" Source="/Tum.PDE.LanguageDSL.Visualization;component/Resources/Images/Cancel-16.png" Margin="2,0,3,0"/>
                    <TextBlock Text="Cancel" Margin="0,0,3,0"/>
                </StackPanel>
            </Button>
        </StackPanel>
    </Grid>
</Window>
